home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / icons / magiciconsortertool / whatis.lha / c / VolName.c < prev    next >
C/C++ Source or Header  |  1994-04-05  |  843b  |  42 lines

  1. /*
  2.  *    VolName.c - Copyright © 1993 by Devil's child.
  3.  *
  4.  *    Created:    16 Mar 1993  22:50:03
  5.  *    Modified:    16 Mar 1993  23:04:05
  6.  *
  7.  *    Make>> sc <file>.c
  8.  *    Make>> slink <file>.o SC SD ND BATCH NOICONS TO <file> LIB LIB:String.lib
  9.  */
  10.  
  11.  
  12. long VolName(void)
  13. {
  14.     struct ExecBase *SysBase = *((struct ExecBase **)4L);
  15.     struct DosLibrary *DOSBase;
  16. //    APTR UtilityBase;
  17.     struct RDArgs *RA;
  18.     char *Argv[] = { NULL, NULL };
  19.     UBYTE *s;
  20.     long rc=20;
  21.  
  22.     if (DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 37)) {
  23. //        UtilityBase = DOSBase->dl_UtilityBase;
  24.         if (RA = ReadArgs("Vol/A", (long *)Argv, NULL)) {
  25.             if (s = StrChr(Argv[0], ':')) {
  26.                 *s = '\0';
  27.                 Printf("%s\n", Argv[0]);
  28.                 rc = 0;
  29.             }
  30.             else
  31.                 rc = 10;
  32.             FreeArgs(RA);
  33.         }
  34.         else
  35.             PrintFault(IoErr(), "VolName");
  36.         CloseLibrary((struct Library *)DOSBase);
  37.     }
  38.     return rc;
  39. }
  40.  
  41.  
  42.